﻿#region Using Statements

#endregion

namespace DirectZZT.Shared.Scripting
{
    /// <summary>
    /// Defines a means for objects to execute scripts (either ZZT-oop or custom one).
    /// </summary>
    public interface IScriptExecutor
    {
        /// <summary>
        /// Returns the flag with the given name.
        /// </summary>
        /// <param name="name">The name of the flag.</param>
        /// <returns>The flag with the given name.
        /// -or- <c>null</c>, if no such flag was found.</returns>
        ScriptFlag GetFlag(string name);
        /// <summary>
        /// Sets/Overwrites the flag.
        /// </summary>
        /// <param name="name">The name of the flag.</param>
        /// <param name="value">The value of the flag to set.</param>
        /// <returns>Whether or not the flag could be set. This usually returns <c>false</c> when being in ZZT-FeatureSet and having used all allowed 10 flags already.</returns>
        bool SetFlag(string name, object value);
        /// <summary>
        /// Removes the flag with the given name. If the flag doesn't exist, nothing will happen.
        /// </summary>
        /// <param name="name">The name of the flag.</param>
        void RemoveFlag(string name);

        /// <summary>
        /// Sends an event to a named object.
        /// </summary>
        /// <param name="objectName">The name of the object to send an event to.</param>
        /// <param name="eventName">The name of the event to send.</param>
        /// <param name="arguments">Optional arguments, appropriate for the event.</param>
        void SendEvent(string objectName, string eventName, params string[] arguments);
    }
}
